import PyV8
from document import *
from navigator import *
from w3c import *

class Location():
	def __init__(self):
		self.hash     = ""
		self.host     = ""
		self.hostname = ""
		self.href	  = ""
		self.pathname = ""
		self.port	  = ""
		self.protocol = ""
		self.search   = ""
		
	def assign(self):
		pass
	def reload(self):
		pass
	def replace(self):
		pass
		
class Screen():
	def __init__(self):
		self.availTop	 = 100
		self.availLeft	 = 100
		self.availHeight = 100
		self.availWidth	 = 100
		self.colorDepth	 = 100
		self.height		 = 100
		self.left		 = 100
		self.pixelDepth	 = 100
		self.top		 = 100
		self.width		 = 100
		
class History():
	def __init__(self):
		self.length 	= None
		self.current	= None
		self.next		= None
		self.previous	= None

	def back(self):
		pass
	def forward(self):
		pass
	def go(self):
		pass
	def pushState(self):
		pass
	def replaceState(self):
		pass

class Window_Object(PyV8.JSClass):
	def __init__(self, URL, HTML, referrer):
		self.closed			  = False
		self.defaultStatus	  = ""
		self.document		  = parseString(HTML)
		self.frameElement	  = None
		self.frames			  = []
		self.history		  = History()
		self.innerHeight	  = 100
		self.innerWidth		  = 100
		self.length			  = len(self.frames)
		self.location		  = URL
		self.name			  = ""
		self.navigator		  = Navigator()
		self.opener			  = None
		self.parent			  = None
		self.screen 		  = Screen()
		self.screenX		  = 0
		self.screenY		  = 0
		self.scrollMaxX		  =	0	 
		self.scrollMaxY		  = 0
		self.scrollX		  = 0
		self.scrollY		  = 0
		self.status			  = ""
		self.top			  = self # Not sure if this will work?
		self.content		  = None
		self.window			  = self
		self.this_win	  	  = self
		
	def vulnerability_alert(self, msg):
		print "\t\t--> Vulnerability Module Tripped: " + msg
		
	def alert(self, msg):
		print "\t\t--> Website attempted alert: " + msg
		
	# Actions
	def onabort(self):
		pass
	def onbeforeunload(self):
		pass
	def onblur(self):
		pass
	def onchange(self):
		pass
	def onclick(self):
		pass
	def onclose(self):
		pass
	def oncontextmenu(self):
		pass
	def ondragdrop(self):
		pass
	def onerror(self):
		pass
	def onfocus(self):
		pass
	def onhashchange(self):
		pass
	def onkeydown(self):
		pass
	def onkeypress(self):
		pass
	def onkeyup(self):
		pass
	def onload(self):
		pass
	def onmousedown(self):
		pass
	def onmousemove(self):
		pass
	def onmouseout(self):
		pass
	def onmouseover(self):
		pass
	def onselect(self):
		pass
	def onsubmit(self):
		pass
	def onunload(self):
		pass
